From a5c2e9df354b4fe7359e5e77ee39dfb2b6edc9d7 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Fri, 2 Sep 2005 09:02:13 +0000 Subject: [PATCH] Clean up tools/check error reporting. Remove logging. Signed-off-by: Keir Fraser --- tools/check/check_brctl | 5 +++-- tools/check/check_iproute | 5 +++-- tools/check/check_logging | 9 +++++---- tools/check/check_python | 4 ++-- tools/check/check_zlib_devel | 5 +++-- tools/check/check_zlib_lib | 5 +++-- tools/check/chk | 25 +++++-------------------- 7 files changed, 24 insertions(+), 34 deletions(-) diff --git a/tools/check/check_brctl b/tools/check/check_brctl index 26f3ce6856..6b8250f5cc 100755 --- a/tools/check/check_brctl +++ b/tools/check/check_brctl @@ -2,8 +2,9 @@ # CHECK-INSTALL function error { - echo 'Check for the bridge control utils (brctl) failed.' + echo + echo ' *** Check for the bridge control utils (brctl) FAILED' exit 1 } -brctl show || error \ No newline at end of file +which brctl 1>/dev/null 2>&1 || error diff --git a/tools/check/check_iproute b/tools/check/check_iproute index 663e0788e5..c990349a9b 100755 --- a/tools/check/check_iproute +++ b/tools/check/check_iproute @@ -2,9 +2,10 @@ # CHECK-INSTALL function error { - echo 'Check for iproute (ip addr) failed.' + echo + echo ' *** Check for iproute (ip addr) FAILED' exit 1 } -ip addr list || error +ip addr list 1>/dev/null 2>&1 || error diff --git a/tools/check/check_logging b/tools/check/check_logging index 941ba618bf..d9f3ff814a 100755 --- a/tools/check/check_logging +++ b/tools/check/check_logging @@ -18,11 +18,12 @@ def check_logging(): import logging except ImportError: hline() - msg("Python logging is not installed.") - msg("Use 'make install-logging' at the xen root to install.") msg("") - msg("Alternatively download and install from") - msg("http://www.red-dove.com/python_logging.html") + msg(" *** Python logging is not installed.") + msg(" *** Use 'make install-logging' at the xen root to install.") + msg(" *** ") + msg(" *** Alternatively download and install from") + msg(" *** http://www.red-dove.com/python_logging.html") hline() sys.exit(1) diff --git a/tools/check/check_python b/tools/check/check_python index 321b32dbbe..a217a67141 100755 --- a/tools/check/check_python +++ b/tools/check/check_python @@ -2,9 +2,9 @@ # CHECK-BUILD CHECK-INSTALL function error { - echo "Check for Python version 2.2 or higher failed." + echo + echo " *** Check for Python version >= 2.2 FAILED" exit 1 } -python -V python -V 2>&1 | cut -d ' ' -f 2 | grep -q -E '^2.2|^2.3|^2.4' || error diff --git a/tools/check/check_zlib_devel b/tools/check/check_zlib_devel index 6f6334bcd0..4986b4403e 100755 --- a/tools/check/check_zlib_devel +++ b/tools/check/check_zlib_devel @@ -2,9 +2,10 @@ # CHECK-BUILD function error { - echo 'Check for zlib includes failed.' + echo + echo " *** Check for zlib headers FAILED" exit 1 } set -e -[ -e /usr/include/zlib.h ] || error \ No newline at end of file +[ -e /usr/include/zlib.h ] || error diff --git a/tools/check/check_zlib_lib b/tools/check/check_zlib_lib index 4e19372843..8820a30371 100755 --- a/tools/check/check_zlib_lib +++ b/tools/check/check_zlib_lib @@ -2,9 +2,10 @@ # CHECK-BUILD CHECK-INSTALL function error { - echo 'Check for zlib library failed.' + echo + echo " *** Check for zlib library FAILED" exit 1 } set -e -ldconfig -p | grep libz.so || error \ No newline at end of file +ldconfig -p | grep -q libz.so || error diff --git a/tools/check/chk b/tools/check/chk index c9b7adead5..7859760bd7 100755 --- a/tools/check/chk +++ b/tools/check/chk @@ -17,14 +17,11 @@ export PATH=${PATH}:/sbin:/usr/sbin case $1 in build) check="CHECK-BUILD" - info="/tmp/xen.chkbuild" ;; install) check="CHECK-INSTALL" - info="/tmp/xen.chkinstall" ;; clean) - rm -f /tmp/xen.chkbuild /tmp/xen.chkinstall exit 0 ;; *) @@ -34,7 +31,7 @@ esac failed=0 -echo "Xen ${check} " $(date) > ${info} +echo "Xen ${check} " $(date) for f in check_* ; do case $f in *~) @@ -49,24 +46,12 @@ for f in check_* ; do if ! grep -q ${check} $f ; then continue fi - echo ' ' >> ${info} - echo "Checking $f" >> ${info} - if ./$f 1>>${info} 2>&1 ; then - echo OK >> ${info} + echo -n "Checking $f: " + if ./$f 2>&1 ; then + echo OK else failed=1 - echo "FAILED $f" - echo FAILED >> ${info} fi done -echo >> ${info} - -if [ "$failed" == "1" ] ; then - echo "Checks failed. See `pwd`/${info} for details." - echo "FAILED" >> ${info} - exit 1 -else - echo "OK" >> ${info} - exit 0 -fi +exit $failed -- 2.30.2